﻿<UserControl x:Class="AssociateProps.CustomerView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
    xmlns:my="clr-namespace:AssociateProps"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400" >
    
    <UserControl.DataContext>
        <my:CustomerViewModel>
            <my:CustomerViewModel.Customer>
                <my:Customer FirstName="John" LastName="Doe" Orders="200" IsActive="True"/>
            </my:CustomerViewModel.Customer>
        </my:CustomerViewModel>
    </UserControl.DataContext>
    
    <Canvas x:Name="LayoutRoot" Background="White">
        <TextBlock Canvas.Left="36" Canvas.Top="34" Height="28" Name="label1" Width="108" Text="First Name:" />
        <TextBlock Canvas.Left="36" Canvas.Top="68" Text="Last Name:" Height="28" Name="label2" Width="108" />
        <TextBlock Canvas.Left="36" Canvas.Top="102" Text="Customer Name:" Height="28" Name="label3" Width="108" />
        <TextBlock Canvas.Left="150" Canvas.Top="108" Height="23" Name="custNameTextBlock" Text="{Binding Path=CustomerName}" Width="120" />
        <TextBlock Canvas.Left="36" Canvas.Top="136" Text="Orders:" Height="28" Name="label4" Width="108" />
        <toolkit:NumericUpDown Canvas.Left="150" Canvas.Top="140" Height="22" Name="ordersUpDown" Width="51" Value="{Binding Path=Customer.Orders}" Visibility="{Binding Path=OrdersVisibility}" />
        <TextBox Canvas.Left="150" Canvas.Top="36" Height="23" Name="firstNameTextBox" Width="120" Text="{Binding Path=Customer.FirstName, Mode=TwoWay}" />
        <TextBox Canvas.Left="150" Canvas.Top="70" Height="23" Name="lastNameTextBox" Width="120" Text="{Binding Path=Customer.LastName, Mode=TwoWay}" />
        <TextBlock Canvas.Left="36" Canvas.Top="170" Height="28" Name="label5" Width="108" Text="Is Active:" />
        <CheckBox Canvas.Left="150" Canvas.Top="175" Height="16" Name="isActiveCheckBox" IsChecked="{Binding Path=Customer.IsActive, Mode=TwoWay}" />
    </Canvas>
</UserControl>
